package com.credit.management.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.management.system.custom.dao.CSyuserMapper;
import com.credit.management.system.generator.dao.SyuserMapper;
import com.credit.management.system.jdbc.dao.SyuserDao;
import com.credit.management.system.model.Page;
import com.credit.management.system.model.Syuser;
import com.credit.management.system.service.ISyuserService;
@Service
public class SyuserService implements ISyuserService {
	@Autowired
	private SyuserMapper syuserMapper;
	@Autowired
	private SyuserDao syuserDao;
	@Autowired
	private CSyuserMapper cSyuserMapper;
	/**
	 * 根据id删除syuser
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return syuserMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入syuser
	 */
	@Override
	public int insertSelective(Syuser syuser) {
		
		return syuserMapper.insertSelective(syuser);
	}
	/**
	 * 根据id查询syuser
	 */
	@Override
	public Syuser selectByPrimaryKey(Integer id) {
		
		return syuserMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改syuser
	 */
	@Override
	public int updateByPrimaryKeySelective(Syuser syuser) {
		
		return syuserMapper.updateByPrimaryKeySelective(syuser);
	}
	//---------------------------custom-----------------------------
	/**
	 * 分页查询syusers
	 */
	@Override
	public Page findPageSyusers(Page page) {
		
		return syuserDao.findPageSyusers(page);
	}
	/**
	 * 找用户拥有和未拥有的角色
	 */
	@Override
	public List<Map<String, Object>> findUserAndRole(Integer id) {
		
		return cSyuserMapper.findUserAndRole(id);
	}

}
